﻿using DevExpress.XtraEditors;
using DevExpress.XtraReports.UI;

namespace Relatorios
{
    public partial class ReportPreview : DevExpress.XtraEditors.XtraForm
    {
        public ReportPreview(XtraReport report)
        {
            InitializeComponent();
            Text = report.DisplayName;
            printControl.PrintingSystem = report.PrintingSystem;
        }

        public static void Preview(XtraReport report)
        {
            new ReportPreview(report).Show();
        }

        public static void Preview(XtraReport report, XtraForm parent)
        {
            var f = new ReportPreview(report);
            f.MdiParent = parent;
            f.Show();
        }

        public static void PreviewDialog(XtraReport report)
        {
            new ReportPreview(report).ShowDialog();
        }
    }
}